/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package cs425proj.model;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;


/**
 *
 * @author prateekpatil & diwakar
 */
public class connectDB {
    
    public Connection con ;
    
     public Connection startConnection(){
         String connStr ="jdbc:oracle:thin:@fourier.cs.iit.edu:1521:orcl";
          try{
               //load the drives
            Class.forName("oracle.jdbc.driver.OracleDriver");

            //initialize the connection variable
               con = DriverManager.getConnection(connStr, "rjairaj", "cs425dbo");
                    
                      
             }catch(SQLException e){e.printStackTrace();}
              catch(ClassNotFoundException cn){cn.printStackTrace();}
           return con; 
          }
     
         public void closeConnection(){
           try{
            con.commit();
            con.close();
    
           }catch(SQLException e){e.printStackTrace();}
             }
    
}
